package com.reactim.user.service;

import com.reactim.user.entity.FriendRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * 好友请求服务接口
 */
public interface FriendRequestService {
    
    /**
     * 发送好友请求
     */
    FriendRequest sendFriendRequest(Long fromUserId, Long toUserId, String message);
    
    /**
     * 接受好友请求
     */
    void acceptFriendRequest(Long requestId, Long userId);
    
    /**
     * 拒绝好友请求
     */
    void rejectFriendRequest(Long requestId, Long userId, String reason);
    
    /**
     * 取消好友请求
     */
    void cancelFriendRequest(Long requestId, Long userId);
    
    /**
     * 获取收到的好友请求
     */
    Page<FriendRequest> getReceivedRequests(Long userId, Pageable pageable);
    
    /**
     * 获取发送的好友请求
     */
    Page<FriendRequest> getSentRequests(Long userId, Pageable pageable);
    
    /**
     * 获取待处理请求数量
     */
    long getPendingRequestCount(Long userId);
    
    /**
     * 检查是否可以发送好友请求
     */
    boolean canSendFriendRequest(Long fromUserId, Long toUserId);
    
    /**
     * 清理过期请求
     */
    int cleanupExpiredRequests();
}